package com.rgz.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.rgz.mapper.UserMapper;
import com.rgz.pojo.User;
import com.rgz.pojo.UserExample;
import com.rgz.pojo.UserExample.Criteria;
import com.rgz.service.UserService;
@Service
public class UserServiceImpl implements UserService {
    @Autowired 
    private UserMapper userMapper;
	
	
	@Override
	public boolean login(User user) {
		UserExample userExample = new UserExample();
		Criteria criteria = userExample.createCriteria();
		criteria.andUsernameQEqualTo(user.getUsernameQ());
		criteria.andPasswordQEqualTo(user.getPasswordQ());
		
		List<User> list = userMapper.selectByExample(userExample);
		if (list!=null&&list.size()>0) {
			return true;
		}
		
		
		return false;
	}

}
